{% extends 'new-layout/layout.html' %}
{% import 'libs/libs.html' as libs %}
{% import 'libs/const.html' as const %}

{% block title_nav %}
<li><a href="/user/">用户管理</a></li>
{% endblock %}

{% block search_body %}
{% 
    set form_config = [
        {'label':'uid', 'name':'uid',},
        {'label':'手机号码', 'name':'mobile', },
        {'label':'真实姓名', 'name':'realname'},
    ] 
%}
{{ libs.build_search_form(form_config) }}

{% endblock %}

{% block data_body %}
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>uid</th>
                <th>头像</th>
                <td>真实姓名</td>
                <th>身份证号码</th>
                <th>性别</th>
                <th>出生年</th>
                <th>城市</th>
                <th>价格</th>
                <th>资质认证</th>
                
            </tr>
        </thead>
        <tbody>
        {% for teacher in teacher_list %}
            <tr>
                <td><a href="{{ url_for('teacher.detail', uid=teacher.uid) }}">{{ teacher.uid }}</a></td>
                <td><img src="{{ teacher.avatar }}" style="width:50px;"></td>
                <td>{{ teacher.realname }}</td>
                <td>{{ teacher.id_no }}</td>
                <td>{{ const.GENDER.get(teacher.gender, 0) }}</td>
                <td>{{ teacher.birth_year }}</td>
                <td>{{ teacher.city }}</td>
                <td>￥{{ teacher.price }}</td>
                <td>{{ const.YES_OR_NO.get(teacher.is_cert)|safe }}</td>
                
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {{ libs.pagination_html(pagination) }}

</div>
{% endblock %}
